package aom.example.security.controller;


import aom.example.security.util.ResultUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/11 15:26
 * @since JDK 1.8
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    /**
     * 首页
     * @Author Sans
     * @CreateTime 2019/10/2 15:23
     * @Return Map<String,Object> 返回数据MAP
     */
    @RequestMapping(value = "/info",method = RequestMethod.GET)
    public Map<String,Object> userLogin(){
        // 组装参数
        Map<String,Object> result = new HashMap<>();
        result.put("title","这里是首页不需要权限和登录拦截");
        return ResultUtil.resultSuccess(result);
    }


    @RequestMapping("adduser")
    @ApiModelProperty("用户注册")
    public JSONObject addUserController(@RequestParam("username")String username,
                                        @RequestParam("password")String password,
                                        @RequestParam("againpassword")String againpassword){
        return new JSONObject();
    }


}
